package com.balabala.gym_system.mapper;

import com.balabala.gym_system.pojo.dto.AdminQueryDto;
import com.balabala.gym_system.pojo.entity.Admin;
import com.balabala.gym_system.pojo.vo.AdminRoleVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.balabala.gym_system.pojo.vo.AdminVo;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Author:zl
 * Date:2023/5/1 9:24
 */

public interface AdminMapper extends BaseMapper<Admin> {
    /**
     * 查询用户以及角色
     * @param adminQueryDto
     * @return
     */
     List<AdminRoleVo> findRole(AdminQueryDto adminQueryDto);

    /**
     * 根据id查用户信息
     * @param id
     * @return
     */
    @Select("SELECT * FROM tb_admin ad,tb_coach co WHERE co.admin_id = ad.id and ad.id=#{id}")
    AdminVo findById(Long id);
}
